﻿using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;

namespace RGG
{
#if DEBUG
    class DebugConfig
    {
        /// <summary>
        /// 获取调试时的文件路径，以'\'结尾
        /// </summary>
        public static string DebugTextPath
        {
            get
            {
                return @"D:\Desktop\学习\C#\RGG\Russian Grid Game\debug\";
            }
        }

        /// <summary>
        /// 打印出数组中非零值得点的坐标
        /// </summary>
        /// <param name="largeDotMatrix"></param>
        /// <param name="fs"></param>
        public static void DrawNonZero(int[,,] largeDotMatrix,Stream s)
        {
            byte[] buffer;
            for (int i = 0; i < largeDotMatrix.GetLength(0); ++i)
            {
                for (int j = 0; j < largeDotMatrix.GetLength(1); ++j)
                {
                    if (largeDotMatrix[i, j, 0] != 0)
                    {
                        buffer = Encoding.Default.GetBytes(string.Format("{0,2},{1,2},{2}\n",i,j,Color.FromArgb(largeDotMatrix[i,j,1])));
                        s.Write(buffer,0,buffer.Length);
                    }
                }
            }

            buffer = Encoding.Default.GetBytes("\r\n");
            s.Write(buffer,0,buffer.Length);
        }

    }
#endif
}
